<?php

namespace App\Goods\Models;

use Illuminate\Database\Eloquent\Model;

class Goods extends Model
{
    protected $table = 'zwj_crm_goods';

    protected $guarded = [];

    public function hasAttr()
    {
        return $this->belongsToMany(GoodsAttr::class, GoodsAttrAuth::class, 'goods_id', 'attr_id');
    }

    public function hasImages()
    {
        return $this->hasMany(GoodsImage::class, 'goods_id');
    }
}
